import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:38917
 * Date:2025/4/11
 * Time:21:18
 */
public class Solution {
    public void rotate(int[] nums, int k) {
        int[] temp = nums.clone();
        int len = nums.length;
        for (int i = 0; i < len; i++) {
            nums[ (i + k) % len ] = temp[i];
        }
    }
    public static void main(String[] args) {
        int[] nums = {1,2,3,4,5,6,7};
        Solution solution = new Solution();
        solution.rotate(nums, 3);
        System.out.println(Arrays.toString(nums));
    }
}
